package com.webchat.chat.model;

import com.webchat.chat.core.enums.UserAccountLockedStatus;
import com.webchat.chat.core.enums.UserAccountType;
import com.webchat.chat.core.enums.UserOnlineStatus;
import com.webchat.chat.core.tools.BaseModel;

import javax.persistence.Column;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class User extends BaseModel implements Serializable {

    /**
     * 租户代号
     */
    @Column(name = "TENANT_CODE")
    private String tenantCode;

    /**
     * 用户名
     */
    @Column(name = "USER_NAME")
    private String userName;

    /**
     * 昵称
     */
    @Column(name = "NICK_NAME")
    private String nickName;

    /**
     * 盐
     */
    @Column(name = "PWD_SALT")
    private String pwdSalt;

    /**
     * 登录密码
     */
    @Column(name = "PWD_LOGIN")
    private String pwdLogin;


    /**
     * 账号类型
     */
    @Column(name = "ACCOUNT_TYPE")
    private UserAccountType accountType;

    /**
     * 账户锁定状态
     */
    @Column(name = "ACCOUNT_LOCKED")
    private UserAccountLockedStatus accountLocked;

    /**
     * 在线状态
     */
    @Column(name = "ONLINE_STATUS")
    private UserOnlineStatus onlineStatus;

    /**
     * 分组ID
     */
    @Column(name = "GROUP_ID")
    private String groupId;

    /**
     * 分组名称
     */
    @Column(name = "GROUP_NAME")
    private String groupName;

    @Transient
    private List<Role> userRoles= new ArrayList<>();

    public List<Role> getUserRoles() {
        return userRoles;
    }

    public void setUserRoles(List<Role> userRoles) {
        this.userRoles = userRoles;
    }

    public String getTenantCode() {
        return tenantCode;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    /**
     * 获取用户名
     *
     * @return USER_NAME - 用户名
     */
    public String getUserName() {
        return userName;
    }

    /**
     * 设置用户名
     *
     * @param userName 用户名
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * 获取昵称
     *
     * @return NICK_NAME - 昵称
     */
    public String getNickName() {
        return nickName;
    }

    /**
     * 设置昵称
     *
     * @param nickName 昵称
     */
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    /**
     * 获取盐
     *
     * @return PWD_SALT - 盐
     */
    public String getPwdSalt() {
        return pwdSalt;
    }

    /**
     * 设置盐
     *
     * @param pwdSalt 盐
     */
    public void setPwdSalt(String pwdSalt) {
        this.pwdSalt = pwdSalt;
    }

    /**
     * 获取登录密码
     *
     * @return PWD_LOGIN - 登录密码
     */
    public String getPwdLogin() {
        return pwdLogin;
    }

    /**
     * 设置登录密码
     *
     * @param pwdLogin 登录密码
     */
    public void setPwdLogin(String pwdLogin) {
        this.pwdLogin = pwdLogin;
    }

    /**
     * 获取账号类型
     *
     * @return ACCOUNT_TYPE - 账号类型
     */
    public UserAccountType getAccountType() {
        return accountType;
    }

    /**
     * 设置账号类型
     *
     * @param accountType 账号类型
     */
    public void setAccountType(UserAccountType accountType) {
        this.accountType = accountType;
    }

    /**
     * 获取账户锁定状态
     *
     * @return ACCOUNT_LOCKED - 账户锁定状态
     */
    public UserAccountLockedStatus getAccountLocked() {
        return accountLocked;
    }

    /**
     * 设置账户锁定状态
     *
     * @param accountLocked 账户锁定状态
     */
    public void setAccountLocked(UserAccountLockedStatus accountLocked) {
        this.accountLocked = accountLocked;
    }

    /**
     * 获取在线状态
     *
     * @return ONLINE_STATUS - 在线状态
     */
    public UserOnlineStatus getOnlineStatus() {
        return onlineStatus;
    }

    /**
     * 设置在线状态
     *
     * @param onlineStatus 在线状态
     */
    public void setOnlineStatus(UserOnlineStatus onlineStatus) {
        this.onlineStatus = onlineStatus;
    }

    /**
     * 获取分组ID
     *
     * @return GROUP_ID - 分组ID
     */
    public String getGroupId() {
        return groupId;
    }

    /**
     * 设置分组ID
     *
     * @param groupId 分组ID
     */
    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    /**
     * 获取分组名称
     *
     * @return GROUP_NAME - 分组名称
     */
    public String getGroupName() {
        return groupName;
    }

    /**
     * 设置分组名称
     *
     * @param groupName 分组名称
     */
    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }
}